//
// Created by Asus on 2025/5/14.
//

#include <iostream>
#include <string>
#include <bits/ostream.tcc>
using namespace std;

struct Books {
    string title;
    string author;
    string subject;
    int book_id;

    Books(string title_, string author_, string subject_, int book_id_) : title(title_), author(author_),
                                                                          subject(subject_), book_id(book_id_) {
    }

    void print() const {
        cout << "Title: " << title << endl;
        cout << "Author: " << author << endl;
        cout << "Subject: " << subject << endl;
        cout << "Book ID: " << book_id << endl;
    }
};

void printBooks(const Books *book) {
    cout << book->title << " " << book->author << " " << book->subject << endl;
    cout << book->book_id << endl;
}

int main(char *argv[]) {
    Books book1("1", "2", "3", 1);
    Books book2("2", "3", "4", 1);

    Books *ptrBook1 = &book1;
    Books *ptrBook2 = &book2;

    printBooks(ptrBook1);
    printBooks(ptrBook2);

    book1.print();
    book2.print();
}

